<include file="Public/header"/>

<div id="app">
    <!-- sidebar -->
    <include file="Public/left"/>
    <!-- / sidebar -->
    <div class="app-content">
        <!-- start: TOP NAVBAR -->
        <include file="Public/headernav"/>
        <!-- end: TOP NAVBAR -->
        <div class="main-content" >
            <div class="wrap-content container" id="container">
                <!-- start: PAGE TITLE -->
                <section id="page-title">
                    <div class="row">
                        <div class="col-sm-8">
                            <h1 class="mainTitle">会员身份验证</h1>
                            <span class="mainDescription"></span>
                        </div>
                        <nav id="cl-effect-10" class="links cl-effect-10">
                            <a data-hover="返回" href="javascript:history.go(-1)"><span>返回</span></a>
                        </nav>
                    </div>
                </section>
                <!-- end: PAGE TITLE -->
                <!-- start: YOUR CONTENT HERE -->



                <table class="table table-striped table-hover" id="sample-table-2">
                    <thead>
                    <tr>
                        <th>会员id</th>
                        <th>正面照</th>
                        <th>背面照</th>
                        <th>真实姓名</th>
                        <th>身份证号</th>
                        <th>上传时间</th>
                        <th>是否审核</th>
                        <th>不通过理由</th>
                     <!--   <th>删除</th>-->
                    </tr>
                    </thead>
                    <tbody>
                    <volist  name="list" id='vo' key='key'>
                        <tr>
                            <td>{$vo.member_id}</td>
                            <td class="center slide" >
                                <img src="{$vo.id_card_front}" class="img-rounded" style="max-width:100px;max-height:100px;" alt="无图片">
                            </td>
                            <td class="center slide" >
                                <img src="{$vo.id_card_back}" class="img-rounded" style="max-width:100px;max-height:100px;" alt="无图片">
                            </td>
                            <td>{$vo.real_name}</td>
                            <td >{$vo.id_number}</td>
                            <td>
                                {$vo.add_time|date="Y-m-d H:i:s",###}
                            </td>
                            <td id="check{$vo.id}">
                                <select class="is_check" data-id="{$vo.id}" name="is_check" >
                                    <option value="0" <if condition="$vo.is_check eq 0">selected</if>>未审核</option>
                                    <option value="1" <if condition="$vo.is_check eq 1">selected</if>>通过</option>
                                    <option value="2" <if condition="$vo.is_check eq 2">selected</if>>不通过</option>
                                </select>
                            </td>
                            <td>
                                <textarea class="reson" data-id="{$vo.id}" name= 'reson' >{$vo.reson}
                                </textarea>
                            </td>
<!--                            <td >
                                <div class="visible-md visible-lg hidden-sm hidden-xs">
                                <a href="{:U("Admin/member/authentication_del",array('id'=>$vo['id']))}" class="btn btn-transparent btn-xs tooltips" tooltip-placement="top" data-toggle="tooltip" data-original-title="删除">
                                    <i class="fa fa-times fa fa-white" onclick="return confirm('确定删除该验证？')"></i>
                                </a>
                                </div>
                            </td>-->
                        </tr>

                    </volist>




                    </tbody>
                </table>
                <div class="col-md-12 pages" align="center">{$list['page']|default='暂无数据'}</div>


                <!-- end: YOUR CONTENT HERE -->
            </div>
        </div>
    </div>
    <!--  FOOTER and SETTINGS -->

    <include file="Public/footer"/>
    <!-- end: FOOTER -->
    <!-- start: OFF-SIDEBAR -->

    <!-- end: OFF-SIDEBAR -->

</div>
<!-- start: MAIN JAVASCRIPTS -->

<include file="Public/javascript"/>

<!-- end: CLIP-TWO JAVASCRIPTS -->
<script type="text/javascript">
    $(function () {
        $('.is_check').change(function () {
            var value=$(this).val();
            var id=$(this).attr('data-id');
            var type='is_check';
            //var reson=$('.reson').val();
           // alert(reson);
            changeCheck(id,value,type);

        });
    });
    $('.reson').blur(function () {
        var value=$(this).val();
        var id=$(this).attr('data-id');
        var type='reson';
        changeCheck(id,value,type);
    });
    function changeCheck(id,value,type){

        if(confirm('确定设置?')){
            $.ajax({
                url:'{:U("Admin/member/do_authentication")}',
                type:'get',
                data:'id='+id+'&value='+value+'&type='+type,
                dataType:'json',
                success : function(data){
                    console.log(data);
                    if(data.status==1){
                        layer.msg('设置成功',{icon:6},function () {
                            if (data.is_check == 2){
                                layer.msg('请填入不通过原因');
                            }
                        });
                    }else{
                        layer.msg(data.error,{icon:5});
                    }
                }
            })
        }
    }


    $('.slide').click(function (e) {
        $('.slide').removeAttr('style');
        $('.slide').find('img').animate({'max-width':'100px','max-height':'100px'});
       $(this).animate({'width':'300px','height':'300px'});
       $(this).find('img').animate({'max-width':'300px','max-height':'300px'});
        e.stopPropagation();
    });
    $(document).click(function (e) {
        $('.slide').removeAttr('style');
        $('.slide').find('img').animate({'max-width':'100px','max-height':'100px'});
    });



</script>
</body>
</html>
